import 'package:flutter_test/flutter_test.dart';
import 'package:jlxc_remote_sdk/jlxc_remote_sdk.dart';
import 'package:jlxc_remote_sdk/jlxc_remote_sdk_platform_interface.dart';
import 'package:jlxc_remote_sdk/jlxc_remote_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockJlxcRemoteSdkPlatform
    with MockPlatformInterfaceMixin
    implements JlxcRemoteSdkPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
  
  @override
  Future init() {
    // TODO: implement init
    throw UnimplementedError();
  }
  
  @override
  Future<String> getSN() {
    // TODO: implement getSN
    throw UnimplementedError();
  }
}

void main() {
  final JlxcRemoteSdkPlatform initialPlatform = JlxcRemoteSdkPlatform.instance;

  test('$MethodChannelJlxcRemoteSdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelJlxcRemoteSdk>());
  });

  test('getPlatformVersion', () async {
    JlxcRemoteSdk jlxcRemoteSdkPlugin = JlxcRemoteSdk();
    MockJlxcRemoteSdkPlatform fakePlatform = MockJlxcRemoteSdkPlatform();
    JlxcRemoteSdkPlatform.instance = fakePlatform;

    expect(await jlxcRemoteSdkPlugin.getPlatformVersion(), '42');
  });
}
